<template>
  <div class="home-container">
    <navbar :showHeaderIcon="true" />

    <div class="xz-list">
      <div class="xz-row">
        <div class="xz-item">
          <div class="item-btn" @click="ck">扫码下载</div>

          <div class="item-title">阅卷/查分小程序</div>

          <p>微信扫描上方二维码</p>
          <p>适用于微信6.5.3以上版本</p>
        </div>
        <div class="xz-item hidden">
          <div class="item-btn">点击下载</div>

          <div class="item-title">扫描客户端</div>

          <p>下载Windows版</p>
          <p>适用于 Windows7 SP1 及以上版本</p>
        </div>
        <div class="xz-item hidden">
          <div class="item-btn" @click="ck">扫码下载</div>

          <div class="item-title">查分小程序</div>

          <p>当前版本：1.2.4</p>
          <p>更新时间：2024.12.04</p>
        </div>
        <div class="xz-item hidden">
          <div class="item-btn">点击下载</div>

          <div class="item-title">华高扫描驱动程序</div>

          <p>当前版本：1.2.4</p>
          <p>更新时间：2024.12.04</p>
        </div>
      </div>
      <div class="xz-row">
        <div class="xz-item hidden">
          <div class="item-btn">扫码下载</div>

          <div class="item-title">中晶扫描驱动程序</div>

          <p>当前版本：1.2.4</p>
          <p>更新时间：2024.12.04</p>
        </div>
        <div class="xz-item hidden">
          <div class="item-btn">扫码下载</div>

          <div class="item-title">佳能扫描驱动程序</div>

          <p>当前版本：1.2.4</p>
          <p>更新时间：2024.12.04</p>
        </div>
        <div class="xz-item hidden">
          <div class="item-btn">扫码下载</div>

          <div class="item-title">柯达扫描驱动程序</div>

          <p>当前版本：1.2.4</p>
          <p>更新时间：2024.12.04</p>
        </div>
        <div class="xz-item hidden">
          <div class="item-btn">点击下载</div>

          <div class="item-title">富士通扫描驱动程序</div>

          <p>当前版本：1.2.4</p>
          <p>更新时间：2024.12.04</p>
        </div>
      </div>
    </div>
    <el-image-viewer
      v-if="imgViewerVisible"
      :on-close="closeImgViewer"
      :url-list="imgList"
    />
  </div>
</template>

<script>
import { Navbar } from "@/layout/components";
export default {
  components: {
    Navbar,
    "el-image-viewer": () =>
      import("element-ui/packages/image/src/image-viewer"),
  },
  data() {
    return {
      imgViewerVisible: false,
      imgList: [require("@/assets/images/20250808151218_193.jpg")],
    };
  },
  methods: {
    closeImgViewer() {
      this.imgViewerVisible = false;
      const m = (e) => {
        e.preventDefault();
      };
      document.body.style.overflow = "auto";
      document.removeEventListener("touchmove", m, true);
    },
    ck() {
      this.imgViewerVisible = true;
      const m = (e) => {
        e.preventDefault();
      };
      document.body.style.overflow = "hidden";
      document.addEventListener("touchmove", m, false); // 禁止页面滑动
    },
  },
};
</script>

<style lang="scss" scoped>
.home-container {
  height: 100vh;
  width: 100vw;
  overflow: auto;
}
.xz-list {
  width: 1200px;
  margin: 0 auto;
  margin-top: 44px;

  .xz-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;

    .xz-item {
      width: 282px;
      height: 263px;
      background: #ffffff;
      box-shadow: 0 4px 10px 0 #5572921a;
      padding: 0 24px;
      box-sizing: border-box;

      &.hidden {
        visibility: hidden;
      }

      .item-btn {
        width: 124px;
        height: 34px;
        background: #1a48db1a;
        border: 1px solid #1a48db;
        border-radius: 4px;
        margin: 0 auto;
        margin-top: 34px;
        color: #1a48db;
        font-size: 14px;
        line-height: 34px;
        text-align: center;
        cursor: pointer;
      }

      .item-title {
        font-size: 16px;
        color: #333333;
        font-weight: bold;
        line-height: 16px;
        padding-top: 24px;
        margin-top: 34px;
        border-top: 1px solid #eff1f4;
        text-align: center;
      }

      p {
        font-size: 14px;
        color: #8e96a4;
        line-height: 14px;
        text-align: center;
        margin-top: 44px;

        & + p {
          margin-top: 14px;
        }
      }
    }
  }
}
</style>